package lab4;

import java.io.*;
import java.net.URI;

import org.apache.hadoop.fs.*;
import org.apache.hadoop.io.IOUtils;
import org.apache.hadoop.conf.Configuration;

import app.deployConf;

public class FileSystemCat {

	public static void main(String[] args) throws Exception {
		String uri = deployConf.url + "/test/test.md";
		Configuration conf = new Configuration();
		FileSystem fs = FileSystem.get(URI.create(uri), conf);
		InputStream in = null;
		try {
			in = fs.open(new Path(uri));
			IOUtils.copyBytes(in, System.out, 4096, false);
		} finally {
			IOUtils.closeStream(in);
		}

	}
}
